import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'
import LayoutView from '@/views/LayoutView/LayoutView.vue'
import HomeView from '../views/HomeView/HomeView.vue'
import AIAnalysisView from '@/views/AIAnalysisView/AIAnalysisView.vue'
import CompositeAnalysisView from '@/views/CompositeAnalysisView/CompositeAnalysisView.vue'
import DueDiligenceView from '@/views/DueDiligenceView/DueDiligenceView.vue'
import LoginView from '@/views/LoginView/LoginView.vue'
import UCenterView from '@/views/UCenterView/UCenterView.vue'
import AboutUSView from '@/views/AboutUSView/AboutUSView.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "layout",
      component: LayoutView,
      children: [
        {
          path: '/',
          name: 'home',
          component: HomeView
        },
        {
          path: '/DueDiligence',
          name: 'DueDiligenceView',
          component: DueDiligenceView
        },
        {
          path:"/DDReportType",
          name:"DDReportType",
          component:() => import("../views/DueDiligenceView/DDReportTypeView.vue")
        },
        {
          path:"/DDReportCheck/:id/:type",
          name:"DDReportCheck",
          component:() => import("../views/DueDiligenceView/DDReportCheckView.vue")
        },
        {
          path:"/DueDiligenceReport",
          name:"DueDiligenceReport",
          component:() => import("../views/DueDiligenceView/AnalyseView.vue")
        },
        {
          path:"/ElectroAuth",
          name:"ElectroAuth",
          component:() => import("../views/DueDiligenceView/ElectroAuth.vue")
        },
        {
          path:"/SCAuth",
          name:"SCAuth",
          component:() => import("../views/DueDiligenceView/SCAuth.vue")
        },
        {
          path: '/AIAnalysis',
          name: 'AIAnalysisView',
          component: AIAnalysisView,
        },
        {
          path:"/ReportType",
          name:"ReportType",
          component:() => import("../views/AIAnalysisView/ReportTypeView.vue")
        },
        {
          path:"/ReportCheck/:id",
          name:"ReportCheck",
          component:() => import("../views/AIAnalysisView/ReportCheckView.vue")
        },
        {
          path: '/CompositeAnalysis',
          name: 'CompositeAnalysisView',
          component: CompositeAnalysisView
        },
        {
          path: '/AboutUS',
          name: 'AboutUSView',
          redirect:"/AboutUS/productinterduce",
          component: AboutUSView,
          children: [
            {
              path: 'companyinterduce',
              name: 'companyinterduce',
              component: () => import('../views/AboutUSView/subViews/CompanyIntroduce.vue')
            },
            {
              path: 'contactus',
              name: 'contactus',
              component: () => import('../views/AboutUSView/subViews/ContactUs.vue')
            },
            {
              path: 'productinterduce',
              name: 'productinterduce',
              component: () => import('../views/AboutUSView/subViews/ProductIntroduce.vue')
            }
          ]
        },
        {
          path: '/UCenter',
          name: 'UCenterView',
          component: UCenterView
        },
        {
          path: '/mzsm',
          name: 'mzsm',
          component: () => import("../views/DueDiligenceView/child/mzsm.vue")
        },
        {
          path: '/xxsq',
          name: 'xxsq',
          component: () => import("../views/DueDiligenceView/child/xxsq.vue")
        }
      ]
    },
    {
      path:"/login",
      name:"LoginView",
      component:LoginView
    },
    {
      path:"/register",
      name:"register",
      component:() => import("../views/LoginView/RegisterView.vue")
    }
  ]
})

export default router
